<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      background-color: pink;
      display: inline-block;
      /* position: absolute;
      top: 50%;
      left: 50%; */
      /* margin-top: -100px;
      margin-left: -100px; */
      /* transform: translate(-50%, -50%); */
    }
    body{
      margin: 0;
      height: 100vh;
      /* display: grid;
      justify-content: center;
      align-items: center; */
      display: table-cell;
      width: 100vw;
      text-align: center;
      vertical-align: middle;
    }
  </style>
</head>
<body>
  <div class="box">
    哈哈哈哈哈哈哈哈哈
  </div>
</body>
</html>